import matplotlib.pyplot as plt
from matplotlib import rcParams

# 设置字体
rcParams['font.sans-serif'] = ['Microsoft YaHei', 'SimHei', 'Arial Unicode MS', 'sans-serif']
rcParams['axes.unicode_minus'] = False  # 解决负号显示问题

def draw_non_functional_requirements_table():
    fig, ax = plt.subplots(figsize=(6, 2))
    ax.axis('off')
    ax.axis('tight')

    data = [
        ["指标", "描述"],
        ["响应时间", "系统在高并发下的响应速度"],
        ["安全性", "用户数据的保护措施"],
        ["可扩展性", "系统的扩展能力"]
    ]

    table = ax.table(cellText=data, colLabels=None, cellLoc='center', loc='center')
    table.auto_set_font_size(False)
    table.set_fontsize(10)
    table.scale(1.2, 1.2)

    plt.title('表2.1_非功能需求指标')
    plt.savefig('表2.1_非功能需求指标.png')
    plt.close()

if __name__ == "__main__":
    draw_non_functional_requirements_table() 